package org.mozhu.zufang.wechat.wx.model;

public class MessageContext {

    private final static ThreadLocal<MessageContext> CONTEXT = new ThreadLocal<MessageContext>();

    String userId;
    Message inputMessage;

    public MessageContext(String userId, Message inputMessage) {
        this.userId = userId;
        this.inputMessage = inputMessage;
    }

    public static MessageContext get() {
        return CONTEXT.get();
    }

    public static void put(MessageContext context) {
        CONTEXT.set(context);
    }

    public static void remove() {
        CONTEXT.remove();
    }

}